import 'package:get/get.dart';
import 'package:yt_devops/pages/devices/device_tab/model/device_item_model.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/utils/formats.dart';

class SelfDevelopEmsDetaiModel {
  List<DetailItemModel> statusItems = [
    DetailItemModel(
      label: ResKey.deviceSystemOperatingMode.tr,
      field: 'systemOperatingMode',
    ),
    DetailItemModel(
      label: ResKey.deviceSystemOperatingState.tr,
      field: 'systemWorkingStatus',
    ),
    DetailItemModel(
      label: ResKey.deviceConverterOperatingMode.tr,
      field: 'converterOperatingMode',
    ),
    DetailItemModel(
      label: ResKey.deviceConverterWorkingState.tr,
      field: 'converterWorkingStatus',
    ),
    DetailItemModel(
      label: ResKey.deviceBatteryPackOperatingMode.tr,
      field: 'batteryPackOperatingMode',
    ),
    DetailItemModel(
      label: ResKey.deviceBatteryStringOperatingStatus.tr,
      field: 'batteryPackWorkingStatus',
    ),
    DetailItemModel(
      label: ResKey.deviceBmsStopSignal.tr,
      field: 'bmsOpenAndClose',
    ),
    DetailItemModel(
      label: ResKey.devicePrechargedContactStatus.tr,
      field: 'prechargeContactStatus',
    ),
    DetailItemModel(
      label: ResKey.deviceDcCircuitBreakerCondition.tr,
      field: 'DCCircuitBreakerStatus',
    ),
    DetailItemModel(
        label: ResKey.deviceAcCircuitBreakerCondition.tr,
        field: 'ACCircuitBreakerStatus',
        format: Formates.closeSelfDevelopFormat),
    DetailItemModel(
        label: ResKey.deviceBmsStopSignal.tr,
        field: 'BmsStopSignal',
        format: Formates.singleSelfDevelopFormat),
    DetailItemModel(
        label: ResKey.deviceSystemEmergencyStopSignal.tr,
        field: 'EmergencyStopSignal',
        format: Formates.singleSelfDevelopFormat),
    DetailItemModel(
        label: ResKey.deviceFireSpraySignal.tr,
        field: 'fsig',
        format: Formates.faultFormat),
  ];

  List<DetailItemModel> setItems = [
    DetailItemModel(
        label: 'siteMonitor.overchargeProtection'.tr,
        field: 'OverchargeProtection',
        format: Formates.voltageFormat),
    DetailItemModel(
        label: 'siteMonitor.overchargeRelease'.tr,
        field: 'OverchargeRelease',
        format: Formates.voltageFormat),
    DetailItemModel(
        label: 'siteMonitor.overDischargeProtection'.tr,
        field: 'OverdischargeProtection',
        format: Formates.voltageFormat),
    DetailItemModel(
        label: 'siteMonitor.overrelease'.tr,
        field: 'Overrelease',
        format: Formates.voltageFormat),
    DetailItemModel(
        label: 'siteMonitor.manualPCSPower'.tr,
        field: 'handOpePcsPower',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}1', //时段1',
      field: 'period1',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, // 执行功率,
        field: 'PCSPeriodPowerOne',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}2', //'时段2',
      field: 'period2',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, // 执行功率,
        field: 'PCSPeriodPowerTwo',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}3', //'时段3',
      field: 'period3',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, // 执行功率,
        field: 'PCSPeriodPowerThree',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}4', //'时段4',
      field: 'period4',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, // 执行功率,
        field: 'PCSPeriodPowerFour',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}5', // '时段5',
      field: 'period5',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, // 执行功率,
        field: 'PCSPeriodPowerFive',
        format: Formates.powerFormat),
  ];

  static const powerMap = {
    'power1': 'PCSPeriodPowerOne',
    'power2': 'PCSPeriodPowerTwo',
    'power3': 'PCSPeriodPowerThree',
    'power4': 'PCSPeriodPowerFour',
    'power5': 'PCSPeriodPowerFive',
  };

  static const timeMap = {
    'time1': [
      'AtTheBeginningOfThePeriodOne',
      'StartingPointOfTimePeriodOne',
      'AtTheEndOfThePeriodOne',
      'PeriodEndMinuteOne',
    ],
    'time2': [
      'AtTheBeginningOfThePeriodTwo',
      'StartingPointOfTimePeriodTwo',
      'AtTheEndOfThePeriodTwo',
      'PeriodEndMinuteTwo',
    ],
    'time3': [
      'AtTheBeginningOfThePeriodThree',
      'StartingPointOfTimePeriodThree',
      'AtTheEndOfThePeriodThree',
      'PeriodEndMinuteThree',
    ],
    'time4': [
      'AtTheBeginningOfThePeriodFour',
      'StartingPointOfTimePeriodFour',
      'AtTheEndOfThePeriodFour',
      'PeriodEndMinuteFour',
    ],
    'time5': [
      'AtTheBeginningOfThePeriodFive',
      'StartingPointOfTimePeriodFive',
      'AtTheEndOfThePeriodFive',
      'PeriodEndMinuteFive',
    ],
  };
}
